Skip to content

Add Purchase Request system with board approval - #16

Open
Ruhanpaco wants to merge 1 commit into
mainfrom
feature/purchase-requests
Open

Add Purchase Request system with board approval#16
Ruhanpaco wants to merge 1 commit into
mainfrom
feature/purchase-requests

Conversation

@Ruhanpaco

Copy link
Copy Markdown
Collaborator

Summary

A standalone feature: members can request to buy something (item name, reason, link, price, quantity, needed-by date). Admin/Leader board members can approve or reject it, with an optional rejection reason.

Backend

  • PurchaseRequest entity + PurchaseRequestStatus enum (Pending/Approved/Rejected), EF config, AddPurchaseRequests migration
  • IPurchaseRequestService/PurchaseRequestService: submit, list-own, board queue, approve, reject — with status guards preventing re-deciding an already-decided request
  • PurchaseRequestsController: create + view-own for any authenticated user; list/approve/reject gated to Admin,Leader
  • Domain events + notification handlers consolidated under DomainEvents/Purchasing/ (reuses the existing shared INotificationService, no duplicate service): board is notified when a request is submitted, submitter is notified when it's approved or rejected
  • 3 new NotificationType cases; DI wired in Program.cs

Frontend

  • purchase-requests.service.ts (thin HttpClient wrapper)
  • "Purchase Requests" page — submit form + your own requests, status tags, rejection reason shown when rejected
  • "Purchase Approvals" page — board-only queue with a view/approve/reject dialog
  • Routes + a "Purchasing" menu section (Approvals link hidden from non-board users; the route itself is also role-guarded)

Test plan

  • Backend builds clean (dotnet build)
  • Frontend builds clean (ng build), both pages compile as separate lazy chunks
  • Manual: submit a request as a normal user, see it Pending
  • Manual: approve one and reject another as Admin/Leader, with a rejection reason
  • Manual: confirm a non-board user is redirected off /dashboard/purchase-approvals
  • Manual: confirm board gets notified on submit, submitter gets notified on the decision

🤖 Generated with Claude Code

Members can request to buy something (item name, reason, link, price,
quantity, needed-by date); Admin/Leader board members approve or reject
with an optional rejection reason.

Backend:
- PurchaseRequest entity + PurchaseRequestStatus enum (Pending/Approved/
  Rejected), EF config, AddPurchaseRequests migration
- IPurchaseRequestService/PurchaseRequestService (submit, list-own,
  board queue, approve, reject) with status guards
- PurchaseRequestsController: create + view-own for any authenticated
  user; list/approve/reject gated to Admin,Leader
- Consolidated per-feature domain events + notification handlers under
  DomainEvents/Purchasing/ (reuses the shared INotificationService):
  board notified on submit, submitter notified on approve/reject
- 3 new NotificationType cases; DI wired in Program.cs

Frontend:
- purchase-requests.service.ts (thin HttpClient wrapper)
- Purchase Requests page (submit + my requests) for everyone
- Purchase Approvals page (approval queue) gated to board
- Routes + Purchasing menu section (approvals hidden from non-board)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Ruhanpaco
Ruhanpaco requested a review from Daxrsa September 3, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant